package com.alinesno.cloud.busines.demo.gateway.dto;

import java.util.Date;

import com.alinesno.cloud.common.facade.dto.BaseDto;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * 功能名： 学生
 * 数据表：  learn_student
 * @author wh ${authorEmail}
 * @date 2021-09-06 22:52:32
 */
public class LearnStudentDto extends BaseDto {
    private static final long serialVersionUID = 1L;
    // fields
        /**
         *  "studentNumber"
         */
        private String studentNumber;
        /**
         *  "studentName"
         */
        private String studentName;
        /**
         *  "collegeId"
         */
        private String collegeId;
        /**
         *  "classId"
         */
        private String classId;
        /**
         *  "admission"
         */
        private Date admission;
    //getter and setter
        public String getStudentNumber()

        {
            return this.studentNumber;
        }

        public LearnStudentDto setStudentNumber(String arg) {
            this.studentNumber = arg;
            return this;
        }
        public String getStudentName()

        {
            return this.studentName;
        }

        public LearnStudentDto setStudentName(String arg) {
            this.studentName = arg;
            return this;
        }
        public String getCollegeId()

        {
            return this.collegeId;
        }

        public LearnStudentDto setCollegeId(String arg) {
            this.collegeId = arg;
            return this;
        }
        public String getClassId()

        {
            return this.classId;
        }

        public LearnStudentDto setClassId(String arg) {
            this.classId = arg;
            return this;
        }
        public Date getAdmission()

        {
            return this.admission;
        }

        public LearnStudentDto setAdmission(Date arg) {
            this.admission = arg;
            return this;
        }

    /**
    * 快速从 dto 转换成 entity
    * @return  dto 对应的 entity
    */
    public LearnStudentDto mapToDto() {
        ObjectMapper toDtoMapper = new ObjectMapper();
        toDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return toDtoMapper.convertValue(this,LearnStudentDto.class);
    }

    /**
    * 快速从 entity 转换成 dto
    * @return  dto 对应的 entity
    */
    public LearnStudentDto fromDto(LearnStudentDto entity) {
        ObjectMapper fromDtoMapper = new ObjectMapper();
        fromDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return fromDtoMapper.convertValue(entity,LearnStudentDto.class);
    }

}
